<?php
// +----------------------------------------------------------------------
// | Author: 发仔 <i@fazi.me> 
// +----------------------------------------------------------------------

namespace app\adminapi\controller;

use think\Controller;
use think\Db;

class Survey extends Base
{
        public function Survey(){
             $where          = json_decode($param['where_json'],true);
             $page = input('page', 1);   
             $pageNum = input('pageNum', 10);
             $P = input('param.');

          $mot_record_return = Db::name('mot_record')->where($where)->whereNull('delete_time')->field('mot_record_id,car_id,mot_add,start_date,end_date,sender,checker,price,state,company,phone,ps')->
                  order('start_date desc')->page($page, $pageNum)->select();
         $car_return = Db::name('car')->where('')->field('number,car_id')->select();
         $count=Db::name('mot_record')->where($where)->count();
             
    
         if($mot_record_return){
             $list=[
                 'count'=>$count,
                 'data'=>$mot_record_return,
             ];
         }
         return $this->retSucc($list);
        }

   
}
